feat: update console OAuth2 provider support#3012
Conversation
Greptile SummaryThis PR consolidates all OAuth2 provider modals into a single dynamic Confidence Score: 3/5Several previously flagged P1 issues (Yammer missing from switch, null dereference on projectToDelete, paypalSandbox key mismatch) remain open per the thread history — resolve those before merging. Score reflects three unresolved P1s from prior review threads that are still present in the diff. The new code itself is generally sound, but those open issues cap confidence below 4. src/routes/(console)/project-[region]-[project]/auth/updateOAuth.ts (Yammer/switch), src/lib/stores/oauth-providers.ts (paypalSandbox key), src/lib/components/organizationUsageLimits.svelte (null dereference) Important Files Changed
Reviews (14): Last reviewed commit: "fix: prevent scope data-loss when listPr..." | Re-trigger Greptile |
- Replace hardcoded OAuth2 provider components with a single dynamic mainOAuth.svelte that fetches labels, placeholders, and hints from listOAuth2Providers; removes 10 now-unused provider-specific files - Load OAuth2 provider list and enabled state from project SDK in +page.ts instead of reading from the project model directly - Fetch API key scopes from listProjectScopes instead of static constants; migrate scopes.svelte to Svelte 5 runes - Add executions.read/write scope definitions and legacy compat pair for execution. -> executions. - Secret field uses write-only card pattern (Tag -> expandable Card); no pre-fill, no silent fallbacks
- authentikDomain → endpoint (Authentik) - auth0Domain → endpoint (Auth0) - tenantID → tenant, clientSecret → applicationSecret (Microsoft) - oktaDomain → domain (Okta) - keyID/teamID → keyId/teamId (Apple) - wellKnownEndpoint/authorizationEndpoint/tokenEndpoint/userinfoEndpoint → wellKnownURL/authorizationURL/tokenUrl/userInfoUrl (OIDC)
- Apple: p8 -> p8File (API field is p8File) - GitLab: clientSecret -> secret (API field is secret) - oauth-providers: paypalsandbox -> paypalSandbox (matches API $id)
Fetch listOAuth2Providers alongside listOAuth2Providers (project) in +page.ts using Promise.all, pass parameters as a prop to mainOAuth. Modal now opens instantly with no spinner or async fetch.
p8File fields now show a drag-and-drop style upload zone by default. Users can click to upload a .p8 file directly or toggle to paste mode for manual entry. Loaded files show a confirmation state with a clear button.
|
@greptile |
Previously a rejected API call left allScopesList empty and mounted stuck at false with no feedback to the user. Now catches the error, displays an inline alert, and sets mounted in finally so the component settles cleanly.
…nabled Parameters with a non-empty example value are treated as required when the provider is enabled. Params without an example (e.g. GitLab endpoint for self-hosted) remain optional regardless of enabled state.
mounted is now only set to true on successful load. On error, it stays false so the $effect never fires, activeScopes stays empty, and the parent-bound scopes prop is never overwritten with [].
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)